package com.liu.frame.utils;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;

/**
 * Created by 刘智强 on 2016/11/7.
 */

public class PermissionUtils {
    //判断系统是否设置了默认浏览器
    public   static boolean hasPreferredApplication(Context context, Intent intent) {
        PackageManager pm = context.getPackageManager();
        ResolveInfo info = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
        return !"android".equals(info.activityInfo.packageName);
    }//如果info.activityInfo.packageName为android,则没有设置,否则,有默认的程序.
}
